* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主菜单样式 */
.main-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 800px;
}

.menu-btn {
    background: white;
    border: none;
    border-radius: 20px;
    padding: 40px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.menu-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.btn-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.menu-btn h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.menu-btn p {
    color: #666;
    font-size: 1rem;
}

.review-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.test-btn:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* 页面通用样式 */
.page {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 70vh;
}

.hidden {
    display: none;
}

.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    margin-right: 20px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a6fd8;
    transform: translateX(-2px);
}

.page-header h2 {
    font-size: 1.8rem;
    color: #333;
}

/* 复习助手样式 */
.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.word-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    text-align: center;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.word-card h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.word-card p {
    font-size: 1rem;
    opacity: 0.9;
}

.word-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
}

.word-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.word-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* 加载动画样式 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    text-align: center;
}

.loading-spinner.hidden {
    display: none !important;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 500;
}

.word-detail {
    margin-top: 30px;
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.word-detail h3 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
}

.meaning-item {
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.meaning-header {
    background: #667eea;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meaning-content {
    padding: 20px;
    display: block;
}

.example {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    line-height: 1.8;
    position: relative;
}

.example:last-child {
    margin-bottom: 0;
}

.example-text {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.example-source {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
}

.highlight {
    font-weight: bold;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

/* 测验助手样式 */
.word-selection {
    text-align: center;
    margin-bottom: 30px;
}

.word-selection h3 {
    margin-bottom: 20px;
    color: #333;
}

.checkbox-group {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 15px 25px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input {
    margin-right: 10px;
    transform: scale(1.2);
}

.start-test-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-test-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.start-test-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 测验内容样式 */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.timer {
    font-size: 1.2rem;
    color: #f5576c;
    font-weight: bold;
}

.progress {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: bold;
}

.question-container {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    line-height: 1.6;
}

.options-container {
    display: grid;
    gap: 15px;
}

.option {
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.option:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.test-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.control-btn:not(:disabled):hover {
    background: #5a6fd8;
}

.submit-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 结果页面样式 */
.test-result {
    text-align: center;
}

.test-result h3 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #333;
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
}

.detailed-results {
    text-align: left;
    margin-bottom: 30px;
}

.result-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #ccc;
}

.result-item.correct {
    background: #d4edda;
    border-left-color: #28a745;
}

.result-item.incorrect {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.restart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* AI功能样式 */
.example-ask-ai {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.example-ask-ai:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* AI对话框样式 */
.ai-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.ai-dialog-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.ai-dialog-header {
    background: #667eea;
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-dialog-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-conversation {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
    min-height: 200px;
}

.ai-message, .user-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.user-message {
    flex-direction: row-reverse;
}

.ai-avatar, .user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ai-avatar {
    background: #667eea;
    color: white;
}

.user-avatar {
    background: #28a745;
    color: white;
}

.ai-text, .user-text {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 70%;
    line-height: 1.5;
}

.user-text {
    background: #667eea;
    color: white;
}

.ai-input-area {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.ai-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.ai-input-area input:focus {
    border-color: #667eea;
}

.ai-input-area button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.ai-input-area button:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .menu-buttons {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .menu-btn {
        padding: 30px 20px;
    }
    
    .word-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .test-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .test-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .ai-dialog-content {
        width: 95%;
        margin: 10px;
    }
    
    .word-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .ai-text, .user-text {
        max-width: 85%;
    }
} 